package brain;

import java.sql.*;
/**
 * @author James Vamplew
 */
public class Connect {  
    
    public static Connection StartConnection() {
    String result = "";
    Connection connect = null;
    try {
            Class.forName("com.mysql.jdbc.Driver");
            String connectionUrl = "jdbc:mysql://localhost:3306/laipa?" + 
                                   "user=root&password=1011351922";
            connect = DriverManager.getConnection(connectionUrl);
            result = "Connected";
        } catch (SQLException sQLE) {
            result = "Failed to connect:\n";
            System.out.println("SQL Exception: "+ sQLE.toString());
        } catch (ClassNotFoundException cNFE) {
            result = "Failed to connect:\n";
            System.out.println("Class Not Found Exception: "+ cNFE.toString());
        }
        System.out.println(result);
        return connect;
    }
}